package com.wwdx.controller.admin;

import com.wwdx.BaseCommons;
import com.wwdx.model.WwdxJdorderModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.Map;

/**
 * @author liguoliang
 * @date 2018/6/8 18:11
 */
@Controller
@RequestMapping("/system/wwdx_jdorder")
public class WwdxJdOrderController extends BaseCommons{

    @RequestMapping("/index")
    public ModelAndView index(){
        return new ModelAndView();
    }

    /**
     * 列表
     */
    @RequestMapping("/list")
    @ResponseBody
    public Map<String,Object> list(WwdxJdorderModel model,
                                   @RequestParam(value = "page", defaultValue = "1") Integer page,
                                   @RequestParam(value = "rows", defaultValue = "10") Integer rows) {

        Map<String,Object> map = new HashMap<>(2);
        map.put("total",  wwdxJdorderService.selectModelCount(model));
        map.put("rows",  wwdxJdorderService.selectModelList(model,page,rows));
        return map;
    }
}